/*
 * @Descripttion: 调用接口公共方法
 * @version: 1.0.0
 * @Author: fanliu
 * @Date: 2020-03-10 10:20:12
 * @LastEditors: fanliu
 * @LastEditTime: 2020-03-10 10:20:12
 */
// http:162.16.2.158:8080/dbank-trunk
// directBank-trunk
// directManager-trunk
// cslive-trunk
// reslive-trunk

// http://bcs.link-us.com.cn/directBank/158/dbank-trunk
// directBank-trunk
// cslive-trunk
// reslive-trunk

const API = {
  // 查询是否登录
  loginIsGo: 'directBank.isLogin',
  // 登录接口
  login: 'dbank.login',
  // 获取token接口
  getOnceToken: 'directBank.getOnceToken',

  // 主页接口 -------------------------------------------
  // 快乐流水贷额度查询接口
  queryLimit: 'directBank/loans/accumulationFundLoan/queryLimit.do',
  // 持有借款列表
  loanListQry: 'directBank/happyLoan/loanListQry.do',
  // 应还借据查询
  recentRepayQry: 'directBank/happyLoan/recentRepayQry.do',

  // 额度申请模块  --------------------------------------
  // 额度申请提交
  limitApply: 'dbank/happyLsLoan/limitApply.do',
  // 短信验证码验证接口
  verifySMSCode: 'directBank/sms/v2/verifySMSCode.do',
  // 推荐人信息查询
  queryStaffId: 'directBank/public/recommend/v0/queryStaffId.do',
  // 短信验证码获取接口
  sendSMSCode: 'directBank/sms/v2/sendSMSCode.do',
  // 快乐流水贷额度查询接口
  queryLimit: 'directBank/loans/accumulationFundLoan/queryLimit.do',
  // 个人信息资料补充
  savePersonalInfor: 'dbank/happyLsLoan/savePersonalInfor.do',
  // 个人信用报告查询报送授权书
  // 快乐流水贷个人综合信息查询授权委托书
  // 快乐流水贷企业综合信息查询授权委托书
  doSearchPdfImage: 'mns0/util/lsdzxcx_0001/doSearchPdfImage.do',

  // 额度激活  -------------------------------------------
  // 额度激活提交
  activateLimit: 'loans/accumulationFundLoan/activateLimit.do',
  // 生成电子合同
  checkSignPdf: 'loans/accumulationFundLoan/checkSignPdf.do',
  // 在途借款
  loanHistoryQry: 'directBank/happyLoan/loanHistoryQry.do',
  // 查询用户云盾开通状态
  queryDevices: 'directBank/cloudSafekeep/queryDevices.do',
  // 获取短信验证码
  sendSMSCode: 'directBank/sms/v2/sendSMSCode.do',
  // 短信验证
  verifySMSCode: 'directBank/sms/v2/verifySMSCode.do',
  
};

//  ===============================================================
/**
* 获取Token
* @returns {Promise}
*/
export const loginIsGo = () => {
  console.log(API.loginIsGo)
  const params = {};
  return app.api.rpc(API.loginIsGo, params);
};
/**
* 获取Token
* @returns {Promise}
*/
export const getOnceToken = (numbers = 1) => {
  const params = {
      numbers: numbers
  };
  return app.api.rpc(API.getOnceToken, params);
};
/**
* 获取所有产品
* @returns {Promise}
*/
export const productList = (params = {}, token = '', options = {}) => {
  return app.api.rpc(API.productList, params, token, options);
};
/**
 * 快乐流水贷额度查询接口
 * 申请信息、申请审批信息、额度激活信息
 * @returns {Promise}
 */
export const queryLimit = (params ={}, token = '', options = {}) => {
  return app.api.rpc(API.queryLimit, params, token, options);
};
/**
 * 持有借款列表
 * @returns {Promise}
 */
export const loanListQry = (params ={}, token = '', options = {}) => {
  return app.api.rpc(API.loanListQry, params, token, options);
};
/**
 * 应还借据查询
 * @returns {Promise}
 */
export const recentRepayQry = (params ={}, token = '', options = {}) => {
  return app.api.rpc(API.recentRepayQry, params, token, options);
};
/**
 * 额度申请提交
 * @returns {Promise}
 */
export const limitApply = (params ={}, token = '', options = {}) => {
  return app.api.rpc(API.limitApply, params, token, options);
};
/**
 * 短信验证码验证接口
 * @returns {Promise}
 */
export const verifySMSCode = (params ={}, token = '', options = {}) => {
  return app.api.rpc(API.verifySMSCode, params, token, options);
};
/**
 * 推荐人信息查询
 * @returns {Promise}
 */
export const queryStaffId = (params ={}, token = '', options = {}) => {
  return app.api.rpc(API.queryStaffId, params, token, options);
};
/**
 * 短信验证码获取接口
 * @returns {Promise}
 */
export const sendSMSCode = (params ={}, token = '', options = {}) => {
  return app.api.rpc(API.sendSMSCode, params, token, options);
};
/**
 * 个人信息资料补充
 * @returns {Promise}
 */
export const savePersonalInfor = (params ={}, token = '', options = {}) => {
  return app.api.rpc(API.savePersonalInfor, params, token, options);
};
/**
 * 个人信用报告查询报送授权书
 * 快乐流水贷个人综合信息查询授权委托书
 * 快乐流水贷企业综合信息查询授权委托书
 * @returns {Promise}
 */
export const doSearchPdfImage = (params ={}, token = '', options = {}) => {
  return app.api.rpc(API.doSearchPdfImage, params, token, options);
};
/**
 * 额度激活提交
 * @returns {Promise}
 */
export const activateLimit = (params ={}, token = '', options = {}) => {
  return app.api.rpc(API.activateLimit, params, token, options);
};
/**
 * 生成电子合同
 * @returns {Promise}
 */
export const checkSignPdf = (params ={}, token = '', options = {}) => {
  return app.api.rpc(API.checkSignPdf, params, token, options);
};
/**
 * 在途借款
 * @returns {Promise}
 */
export const loanHistoryQry = (params ={}, token = '', options = {}) => {
  return app.api.rpc(API.loanHistoryQry, params, token, options);
};
/**
 * 查询用户云盾开通状态
 * @returns {Promise}
 */
export const queryDevices = (params ={}, token = '', options = {}) => {
  return app.api.rpc(API.queryDevices, params, token, options);
};